package com.cmc.cloud.cmclink.doc.convert;

import com.cmc.cloud.cmclink.doc.dto.DgProhibitedUpdateDto;
import com.cmc.cloud.cmclink.doc.entity.DgProhibitedDO;
import com.cmc.cloud.cmclink.doc.entity.DgProhibitedWithSubDO;
import com.cmc.cloud.cmclink.doc.vo.special.dgprohibitedvo.DgProhibitedBaseVO;
import com.cmc.cloud.cmclink.doc.vo.special.dgprohibitedvo.DgProhibitedExcelVO;
import com.cmc.cloud.cmclink.doc.vo.special.dgprohibitedvo.DgProhibitedRespVO;
import com.cmc.cloud.cmclink.doc.vo.special.dgprohibitedvo.DgProhibitedUpdateReqVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 危险品禁接清单 Convert
 *
 * @author 集运管理员
 */
@Mapper
public interface DgProhibitedConvert {

    DgProhibitedConvert INSTANCE = Mappers.getMapper(DgProhibitedConvert.class);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    DgProhibitedDO convert(DgProhibitedBaseVO bean);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    DgProhibitedDO convertUpdate(DgProhibitedUpdateDto bean);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    DgProhibitedDO convert(DgProhibitedUpdateReqVO bean);

    /**
     * 属性转换 convert
     *
     * @param bean
     * @return
     */
    DgProhibitedRespVO convert(DgProhibitedDO bean);

    /**
     * 属性转换 convert
     *
     * @param list
     * @return
     */
    List<DgProhibitedRespVO> convertList(List<DgProhibitedDO> list);

    /**
     * 属性转换 convert
     *
     * @param list
     * @return
     */
    @Mappings(value = {@Mapping(target = "createTime", source = "createTime", dateFormat = "dd-MM-yyyy HH:mm:ss"),
            @Mapping(target = "updateTime", source = "updateTime", dateFormat = "dd-MM-yyyy HH:mm:ss")})
    List<DgProhibitedExcelVO> convertExcelList(List<DgProhibitedWithSubDO> list);
}
